package icu.feigroup.domain.trade.model.valobj;

import lombok.*;

/**
 * projectName:icu.feigroup.domain.trade.model.valobj
 *
 * @author 飞
 * @since 2025/2/23 11:57
 * description:
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum TradeOrderStatusEnumVO {

    CREATE(0, "初始创建"),
    COMPLETE(1, "消费完成"),
    CLOSE(2, "超时关单"),
    ;

    private Integer code;
    private String info;

    //对应数据库中的字段
    public static TradeOrderStatusEnumVO valueOf(Integer code) {
        switch (code) {
            case 0:
                return CREATE;
            case 1:
                return COMPLETE;
            case 2:
                return CLOSE;
        }
        return CREATE;
    }
}
